package com.shujia.flink.sql

import org.apache.flink.table.functions.ScalarFunction
import java.sql.Timestamp

/***
  * 编写自定义函数
  *
  *  函数方法的名称必须是  eval
  */

class UTC2Local extends ScalarFunction{

  def eval(s: Timestamp): Timestamp = {

    //将时间加8小时
    val timestamp: Long = s.getTime + 28800000

    //返回时间戳
    new Timestamp(timestamp)

  }

}
